package chai.ningning.multipe;

public class MultiThreadTest1 {

    public static void main(String[] args) {

        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 5; i++) {
                    System.out.println(Thread.currentThread().getName()+"-"+i);
                }
            }
        };

        Thread thread = new Thread(runnable,"first");// Threat( Runnable target , String name )
        Thread thread1 = new Thread(runnable,"second");
        Thread thread2 = new Thread(runnable,"third");

        thread2.start();
        thread1.start();
        thread.start();
    }
}
